<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<h1>结果页面</h1>
<div id="userinfo">
    <div class="form-group">
        <label for="name">姓名</label>
        <input type="text" class="form-control" id="name" name="name" placeholder="请输入姓名" disabled>
    </div>
    <div class="form-group">
        <label for="studentId">学号</label>
        <input type="text" class="form-control" id="studentId" name="studentId" placeholder="请输入学号" disabled>
    </div>
    <div class="form-group">
        <label for="grade">年级</label>
        <input type="text" class="form-control" id="grade" name="grade" placeholder="请输入年级" disabled>
    </div>
    <div class="form-group">
        <label for="major">专业</label>
        <input type="text" class="form-control" id="major" name="major" placeholder="请输入专业名称" disabled>
    </div>
    <div class="form-group">
        <label for="college">学院</label>
        <input type="text" class="form-control" id="college" name="college" placeholder="请输入学院名称" disabled>
    </div>
</div>
<div id="xuanke">
所选课程：<br/>
</div>
</body>
<script>
    $(function (){
        $.ajax({
            url:"/getResult",
            type:"get",
            success:function (res){
                console.log(res)
                var user = res.user
                $("#name").val(user.name)
                $("#studentId").val(user.studentId)
                $("#grade").val(user.grade)
                $("#major").val(user.major)
                $("#college").val(user.college)
                var xuanke= res.xuanke
                $.each(xuanke,function(n,value) {
                    //alert(n+' '+value);
                    $("#xuanke").append(value+"<br/>")
                });
            }
        })
    })
</script>
</html>